﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web;

namespace BO
{
    public class lib
    {
        public static int ProID
        {
            get
            {
                if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["ProID"])) return 0;

                return Object2Integer(HttpContext.Current.Request.QueryString["ProID"]);
            }
        }
        public static int ParentID
        {
            get
            {
                if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["ParentID"])) return 0;

                return Object2Integer(HttpContext.Current.Request.QueryString["ParentID"]);
            }
        }
        public static int ZoneID
        {
            get
            {
                if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["ZoneID"])) return 0;

                return Object2Integer(HttpContext.Current.Request.QueryString["ZoneID"]);
            }
        }
        public static int NewsID
        {
            get
            {
                if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["NewsID"])) return 0;

                return Object2Integer(HttpContext.Current.Request.QueryString["NewsID"]);
            }
        }
        public static int PageType
        {
            get
            {
                if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["PageType"])) return 0;

                return Object2Integer(HttpContext.Current.Request.QueryString["PageType"]);
            }
        }
        public static int PageIndex
        {
            get
            {
                if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["PageIndex"])) return 0;

                return Object2Integer(HttpContext.Current.Request.QueryString["PageIndex"]);
            }
        }
        public static int CompanyID
        {
            get
            {
                if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["CompanyID"])) return 0;

                return Object2Integer(HttpContext.Current.Request.QueryString["CompanyID"]);
            }
        }
        public static int PageSize
        {
            get
            {
                if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["PageSize"])) return 0;

                return Object2Integer(HttpContext.Current.Request.QueryString["PageSize"]);
            }
        }
        public static int Object2Integer(object value)
        {
            if (null == value) return 0;
            try
            {
                return Convert.ToInt32(value);
            }
            catch
            {
                return 0;
            }
        }
        public static string Url
        {
            get
            {
                if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["Url"])) return "";

                return HttpContext.Current.Request.QueryString["Url"];
            }
        }
        public static string UrlZone
        {
            get
            {
                if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["UrlZone"])) return "";

                return HttpContext.Current.Request.QueryString["UrlZone"];
            }
        }
        public static string UrlP
        {
            get
            {
                if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["UrlP"])) return "";

                return HttpContext.Current.Request.QueryString["UrlP"];
            }
        }
        public static string KeySearch
        {
            get
            {
                if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["KeySearch"])) return "";

                return HttpContext.Current.Request.QueryString["KeySearch"];
            }
        }
    }
}
